home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr27 / p5bug10.zip / P5BUG.TXT < prev    next >
Text File  |  1994-11-29  |  4KB  |  121 lines

  1.  
  2.  From dorai@cps.msu.edu Wed Nov 23 18:34:13 1994
  3.  To: prip@pixel.cps.msu.edu
  4.  Subject: Serious bug in the pentium chip...
  5.  Content-Length: 4150
  6.  
  7.  From gann@dirac.CChem.Berkeley.EDU Wed Nov 23 17:13:35 EST 1994
  8.  Subject: Serious bug in Intel's Pentium CPU
  9.  Date: 23 Nov 1994 07:07:18 GMT
  10.  Organization: University of California/Lawrence Berkeley Laboratories
  11.  
  12.  If you rely on an Intel Pentium to do double precision floating point
  13.  calculations then you should be aware that a bug has been discovered
  14.  concerning floating point calculations.
  15.  
  16.  The following post from a representative of Mathworks which sell MATLAB
  17.  give some details. (I am not sure where this post originated, I believe
  18.  the MATLAB newsgroup.) If you want more information, read
  19.  comp.sys.intel where the most update information can be found.
  20.  
  21.  Note that if you own a pentium-based machine you almost certainly have
  22.  this bug. No one has reported NOT having the bug.
  23.  
  24.  S. L. Gann
  25.  University of California, Berkeley
  26.  Lawrence Berkeley Laboratories
  27.  
  28.  
  29.  
  30.  From: moler@mathworks.com (Cleve Moler)
  31.  
  32.  
  33.                Pentium Floating Point Division Bug
  34.  
  35.  There has been a flurry of activity the last fews days on the
  36.  Internet news group, comp.sys.intel, that should interest MATLAB
  37.  users.  A serious design flaw has been discovered in the floating
  38.  point unit on Intel's Pentium chip.  Double precision divisions
  39.  involving operands with certain bit patterns can produce incorrect
  40.  results.
  41.  
  42.  The most dramatic example seen so far can be extracted from a
  43.  posting last night by Tim Coe of Vitesse Semiconductor.  In MATLAB,
  44.  his example becomes
  45.  
  46.      x = 4195835
  47.      y = 3145727
  48.      z = x - (x/y)*y
  49.  
  50.  With exact computation, z would be zero.  In fact, we get zero on
  51.  most machines, including those using Intel 286, 386 and 486 chips.
  52.  Even with roundoff error, z should not be much larger than eps*x,
  53.  which is about 9.3e-10.  But, on the Pentium,
  54.  
  55.      z = 256
  56.  
  57.  The relative error, z/x, is about 2^(-14) or 6.1e-5.  The computed
  58.  quotient, x/y, is accurate to only 14 bits.
  59.  
  60.  An article in last week's edition of Electronic Engineering Times
  61.  credits Prof. Thomas Nicely, a mathematics professor at Lynchburg
  62.  College in Virginia, with the first public announcement of the
  63.  Pentium division bug.  One of Nicely's examples involves
  64.  
  65.      p = 824633702441
  66.  
  67.  With exact computation
  68.  
  69.      q = 1 - (1/p)*p
  70.  
  71.  would be zero.  With floating point computation, q should be on
  72.  the order of eps.  On most machines, we find that
  73.  
  74.      q = eps/2 = 2^(-53) ~= 1.11e-16
  75.  
  76.  But on the Pentium
  77.  
  78.      q = 2^(-28) ~= 3.72e-09
  79.  
  80.  This is roughly single precision accuracy and is typical of the
  81.  most of the examples that had been posted before Coe's analysis.
  82.  
  83.  The bit patterns of the operands involved in these examples
  84.  are very special.  The denominator in Coe's example is
  85.  
  86.      y = 3*2^20 - 1
  87.  
  88.  Nicely's research involves a theorem about sums of reciprocals
  89.  of prime numbers.  His example involves a prime of the form
  90.  
  91.      p = 3*2^38 - 18391
  92.  
  93.  We're not sure yet how many operands cause the Pentium's floating
  94.  point division to fail, or even what operands produce the largest
  95.  relative error.  It is certainly true that failures are very rare.
  96.  But, as far as we are concerned, the real difficulty is having to
  97.  worry about this at all.  There are so many other things than can
  98.  go wrong with computer hardware, and software, that, at least, we
  99.  ought to be able to rely on the basic arithmetic.
  100.  
  101.  The bug is definitely in the Pentium chip.  It occurs at all clock
  102.  rates.  The bug does not affect other arithmetic operations, or the
  103.  built-in transcendental functions.  Intel has recently made changes
  104.  to the on-chip Program Logic Array that fix the bug and is now
  105.  believed to be producing error free CPUs.  It remains to be seen
  106.  how long it will take for these to reach users.
  107.  
  108.  An unnamed Intel spokesman is quoted in the EE Times article as
  109.  saying "If customers are concerned, they can call and we'll replace
  110.  any of the parts that contain the bug."  But, at the MathWorks,
  111.  we have our own friends and contacts at Intel and we're unable
  112.  to confirm this policy.  We'll let you know when we hear anything
  113.  more definite.  In the meantime, the phone number for Customer
  114.  Service at Intel is 800-628-8686.
  115.  
  116.     -- Cleve Moler
  117.     Chairman and Chief Scientist
  118.     The MathWorks, Inc.
  119.     moler@mathworks.com
  120.  
  121.